package ExerciseGroup;/*
* 循环嵌套的练习
*
* */

/*public class ForForTest {
    public static void main(String[] args) {

        //对循环嵌套的理解
        for(int outSide = 0; outSide < 4; outSide++){
            for (int inSide = 0; inSide < 6; inSide++){
                System.out.print("*");
            }
            System.out.println();
        }

        System.out.println();

        //加强理解
        for(int outSide = 1; outSide <= 5; outSide++){
            for (int inSide = 1; inSide <= outSide; inSide++){
                System.out.print("*");
            }
            System.out.println();
        }

        System.out.println();

        for(int outSide = 1; outSide <= 5; outSide++){
            for (int inSide = 1; inSide <= 5 - outSide; inSide++){
                System.out.print("*");
            }
            System.out.println();
        }
    }
}*/

/*
*      *
*     * *
*    * * *
*   * * * *
*  * * * * *
*
*
* */

public class ForForTest {
    public static void main(String[] args) {
        for (int outSide = 1; outSide <= 5; outSide++){
            for (int midSide = 1; midSide <= 6 - outSide; midSide++){
                System.out.print(" ");
            }
            for (int inSide = 1; inSide <= outSide; inSide++){
                System.out.print("* ");
            }
            System.out.println();
        }
        for (int outSide = 1; outSide <= 4; outSide++ ){
            for (int midSide = 1; midSide <= 1 + outSide; midSide++){
                System.out.print(" ");
            }

            for (int inSide = 1; inSide < 6 - outSide; inSide++){
                System.out.print("* ");
            }


            System.out.println();
        }
    }
}
